#include "time.h"
#include "oled.h"
#include "drv_OpticalCar.h"


void drv_Car_Init() {
    // ===== critical hardware init =====
    SysTick_Init();
    Car_HardwareInit();
    
    // ===== functional modules init =====
    delay_us(100000);  // Wait 100 ms for OLED to power up
    OLED_Init();  // Init OLED first to display info
    Car_PWM_Init();
    Car_TOF_Init();
}


void Car_LED_PWR_On() {
    GPIO_ResetBits(PORT_LED_PWR, PIN_LED_PWR);
}


void Car_LED_PWR_Off() {
    GPIO_SetBits(PORT_LED_PWR, PIN_LED_PWR);
}

